<template>
  <div style="padding:20px;" id="app">
    <div class="panel panel-primary">
      <div class="panel-heading">ceshi</div>
      <div class="align-center">
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      prop="dname"
      label="数据源名称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="dtype"
      label="数据源类型"
      width="180">
    </el-table-column>
      <el-table-column
        prop="dadress"
        label="连接地址">
      </el-table-column>
  </el-table>
</div>
  </div>
  </div>
</template>

<script>
    export default {
      data() {
        return {
          tableData: [{
            dname: '2016-05-02',
            dtype: '王小虎',
            dadress: '上海市普陀区金沙江路 1518 弄'
          }]
        }
      },
      methods: {
        onSubmit() {
          console.log('submit!');
          this.$http.post('http://127.0.0.1:8091/datasource/listDatasourceByType',
            {
              "dtype":0,
            }
            ,{emulateJSON: true}).then((response) => {
              // if(response.bodyText = "success"){
                this.tableData = response.body
            });
            // }

         }
       },
      created() {
        this.$http.post('http://127.0.0.1:8091/datasource/listDatasourceByType',
          {
            "dtype":0,
          }
          ,{emulateJSON: true}).then((response) => {
          // if(response.bodyText = "success"){
          this.tableData = response.body
        });
      }
    }
</script>

<style type="text/css">
  .align-center{
    margin:0 auto;      /* 居中 这个是必须的，，其它的属性非必须 */
    width:1000px;        /* 给个宽度 顶到浏览器的两边就看不出居中效果了 */
    background:white;     /* 背景色 */
    text-align:center;  /* 文字等内容居中 */
  }
</style>
